<link rel="stylesheet" href="views/login/login.css">
<div class="form-div">
    <h1 class="am-u-sm-12">登录</h1>
    <form class="am-form am-form-horizontal loginForm" name="loginForm" ng-submit="login()">
        <div class="am-form-group"
             ng-class="{true:'am-form-error'}[
         loginForm.email.$invalid && loginForm.email.$dirty
         ]">
            <label for="email" class="am-u-sm-3 am-form-label">电子邮件</label>
            <div class="am-u-sm-9">
                <input required type="email" name="email" ng-model="user.email" class="am-form-field"
                       id="email" placeholder="输入你的电子邮件">
            </div>
            <div class="am-u-sm-offset-3 am-u-sm-9 am-text am-text-danger"
                 ng-show="loginForm.email.$dirty && loginForm.email.$invalid">
                <span ng-show="loginForm.email.$error.required">邮箱不能为空</span>
                <span ng-show="loginForm.email.$error.email">邮箱格式不正确</span>
            </div>
        </div>

        <div class="am-form-group"
             ng-class="{true:'am-form-error'}[loginForm.password.$invalid && loginForm.password.$dirty ]">
            <label for="password" class="am-u-sm-3 am-form-label">密码</label>
            <div class="am-u-sm-9">
                <input required type="password" name="password" ng-minlength="6" ng-maxlength="10"
                       ng-model="user.password"
                       class="am-form-field" id="password" placeholder="设置一个密码吧">
            </div>
            <div class="am-u-sm-offset-3 am-u-sm-9 am-text am-text-danger"
                 ng-show="loginForm.password.$dirty && loginForm.password.$invalid">
                <span ng-show="loginForm.password.$error.required">密码不能为空</span>
                <span ng-show="loginForm.password.$error.minlength">密码为6-10位，当前不足6位</span>
                <span ng-show="loginForm.password.$error.maxlength">密码为6-10位，当前超过10位</span>

            </div>
        </div>

        <div class="am-form-group">
            <div class="am-u-sm-offset-3 am-u-sm-9" ng-init="user.isRemember=false">
                <div class="checkbox">
                 <span style="margin-left: 10px" class="am-text"
                       ng-class="{true:'am-text-success'}[user.isRemember]"> 记住</span>
                    <input ng-model="user.isRemember" id="remember"
                           type="checkbox" class="iphone-check "
                           ng-class="{true:'iphone-checked',false:'iphone-unchecked'}[user.isRemember]">
                    <label for="remember" class="am-u-sm-3 am-form-label "
                           ng-class="{true:'iphone-label-checked',false:'iphone-label-unchecked'}[user.isRemember]"
                    ></label>
                </div>
            </div>
        </div>

        <div class="am-form-group">
            <div class="am-u-sm-10 am-u-sm-offset-2">
                <button type="submit" ng-disabled="loginForm.$invalid" class="am-btn am-btn-primary am-u-sm-10">登录
                </button>
            </div>
        </div>
        <div class="am-u-sm-offset-2 am-u-sm-10 am-text am-text-danger"
             ng-show="erroMsg.result==0">
            <span ng-bind="erroMsg.msg"></span>
        </div>
    </form>
</div>